package www.xpu.edu.app;



public class Test2 {
    public static void main(String[] args) {
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                System.out.print(function(i,j,0,1)+" ");
            }
            System.out.println();
        }
        System.out.println("====================");
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(function(i,j,1,2)+" ");
            }
            System.out.println();
        }
    }
    public static int function(int r1,int c1,int r2,int c2)
    {
        return Math.abs(r1-r2)+Math.abs(c1-c2);
    }



}
